package com.ruoyi.business.controller;

import com.ruoyi.business.domain.TBusinessApplication;
import com.ruoyi.business.service.TBusinessApplicationService;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.framework.config.ServerConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

@RestController
@RequestMapping("/business")
public class BusinessController extends BaseController {
    @Autowired
    private ServerConfig serverConfig;

    @Autowired
    private TBusinessApplicationService tBusinessApplicationService;

    @RequestMapping("/test")
    public AjaxResult test1(){
        return AjaxResult.success("成功");
    }

    @PostMapping("/application")
    public AjaxResult app(@RequestBody TBusinessApplication tBusinessApplication) throws IOException {
        return tBusinessApplicationService.submitAppForm(tBusinessApplication);
    }

    @GetMapping("/getAppData")
    public AjaxResult appDataState(@RequestParam("userId")int userId){
        return tBusinessApplicationService.getAppData(userId);
    }
}
